/*++

Copyright (c) 1989 - 1999 Microsoft Corporation

Module Name:

    DownLvlI.c

Abstract:

    This module implements downlevel fileinfo, volinfo, and dirctrl.

--*/

#include "precomp.h"
#pragma hdrstop

#include "mrxglobs.h"
#include "host_access.h"

NTSTATUS
HwFsTruncateFile(
    IN OUT struct _RX_CONTEXT * RxContext
    )
{
    // This function seems obsoleted. Nobody implements it.
    UNREFERENCED_PARAMETER(RxContext);

    HWFS_DBG_PRINT(DBG_ERR, DBG_ANY, ("Truncate called!\n"));

    return STATUS_NOT_IMPLEMENTED;
}

ULONG
HwFsExtendFile(
    IN OUT struct _RX_CONTEXT * RxContext,
    IN OUT PLARGE_INTEGER   pNewFileSize,
    OUT PLARGE_INTEGER   pNewAllocationSize
    )
/*++

Routine Description:

   This routine handles requests to extend the file for cached IO.

Arguments:

    RxContext - the RDBSS context

Return Value:

    NTSTATUS - The return status for the operation

--*/
{
    PHWFS_FCB_EXTENSION pFcbExt = RxContext->pFcb->Context;
    PHWFS_FILE_INFO pFi = &pFcbExt->FileInfo;

    // Write to the file will extend it anyway. Just update the internal size.
    pNewAllocationSize->QuadPart = ROUND_TO_PAGES(pNewFileSize->QuadPart);
    pFi->StandardInfo.AllocationSize.QuadPart = pNewAllocationSize->QuadPart;
    pFi->StandardInfo.EndOfFile.QuadPart = pNewFileSize->QuadPart;

    return STATUS_SUCCESS;
}

